package com.jinzhuo.music.service;

import com.jinzhuo.music.dao.SongListMapper;
import com.jinzhuo.music.domain.SongList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 歌单实现类
 */
@Service
public class SongListServiceImpl implements SongListService {
    @Autowired
    private SongListMapper songListMapper;
    /**
     * 添加
     *
     * @param pojo
     */
    @Override
    public boolean addSongList(SongList pojo) {
        return songListMapper.addSongList(pojo)>0;
    }

    /**
     * 修改
     *
     * @param pojo
     */
    @Override
    public boolean updateSongList(SongList pojo) {
        return songListMapper.updateSongList(pojo)>0;
    }

    /**
     * 删除
     *
     * @param id
     */
    @Override
    public boolean deleteSongList(Integer id) {
        return songListMapper.deleteSongList(id)>0;
    }

    /**
     * 根据主键查询单个对象
     *
     * @param id
     */
    @Override
    public SongList getSongList(Integer id) {
        return songListMapper.getSongList(id);
    }

    /**
     * 查询所有歌单
     */
    @Override
    public List<SongList> queryAllSongList() {
        return songListMapper.queryAllSongList();
    }

    /**
     * 根据标题精确查询歌单
     *
     * @param title
     */
    @Override
    public List<SongList> querySongListByTitle(String title) {
        return songListMapper.querySongListByTitle(title);
    }

    /**
     * 根据标题模糊查询歌单
     *
     * @param title
     */
    @Override
    public List<SongList> querySongListLikeTitle(String title) {
        return songListMapper.querySongListLikeTitle(title);
    }

    /**
     * 根据风格模糊查询歌单
     *
     * @param style
     */
    @Override
    public List<SongList> querySongListLikeStyle(String style) {
        return songListMapper.querySongListLikeStyle(style);
    }
}
